<template>
	<view class="container">
		<!-- 自定义导航栏 -->
		<view class="custom-navbar">
			<view class="navbar-left"></view>
			<view class="navbar-title">支付成功</view>
			<view class="navbar-right" @click="navigateToHome">
				<text class="confirm-text">完成</text>
			</view>
		</view>

		<!-- 支付成功内容 -->
		<view class="success-content">
			<!-- 成功图标 -->
			<uni-icons type="checkbox-filled" size="80" color="#4CAF50" class="success-icon"></uni-icons>

			<!-- 提示文字 -->
			<text class="success-text">支付成功!</text>
			<text class="success-finish">订单已完成,感谢您的购买</text>
			<!-- 订单信息 -->
			<!-- 	<view class="order-info">
				<text class="info-item">订单金额：¥{{ orderInfo.amount }}</text>
				<text class="info-item">支付方式：{{ orderInfo.paymentMethod }}</text>
				<text class="info-item">订单编号：{{ orderInfo.orderNo }}</text>
			</view> -->
		</view>

		<!-- 操作按钮 -->
		<view class="action-buttons">
			<button class="btn check-order" @click="moreGoods">查看更多商品</button>
			<button class="btn back-home" @click="navigateToHome">返回首页</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderInfo: {
					amount: '299.00',
					paymentMethod: '微信支付',
					orderNo: '20230825123456789'
				}
			}
		},
		methods: {
			// 跳转首页
			navigateToHome() {
				uni.switchTab({
					url: '/pages/shop-homepage/shop-homepage'
				})
			},

			// 查看更多商品
			moreGoods() {
				uni.navigateTo({
					url: '/pages/shop-homepage/shop-moregoods'
				})
			}
		}
	}
</script>

<style scoped>
	.container {
		height: 100vh;
		background-color: #f8f8f8;
	}

	/* 自定义导航栏 */
	.custom-navbar {
		/* 	height: 44px;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 15px;
		background-color: #fff;
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); */

		display: flex;
		padding: 10px 15px;
		background-color: #fff;
		box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
	}

	.navbar-title {
		/* font-size: 17px;
		color: #333;
		font-weight: 500; */
		font-size: 17px;
		color: #333;
		font-weight: 700;
		flex: 1;
		text-align: center;
		margin-left: 20px;
	}

	.confirm-text {
		/* color: #4CAF50; */
		font-size: 16px;
	}

	/* 主要内容区域 */
	.success-content {
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-top: 35px;
	}

	.success-icon {
		margin-bottom: 10px;
		animation: scaleIn 0.6s ease-in-out;
	}

	.success-text {
		font-size: 24px;
		color: #333;
		margin-bottom: 10px;
		/* font-weight: 500; */
		font-weight: 700;
	}

	.success-finish {
		font-size: 16px;
		color: #333;
		margin-bottom: 10px;
	}

	/* 订单信息 */
	.order-info {
		background: #fff;
		padding: 20px;
		border-radius: 12px;
		width: 85%;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
	}

	.info-item {
		display: block;
		font-size: 14px;
		color: #666;
		line-height: 1.8;
		margin: 8px 0;
	}

	/* 操作按钮 */
	.action-buttons {
		position: fixed;
		bottom: 40px;
		left: 0;
		right: 0;
		padding: 0 20px;
		display: flex;
		justify-content: space-between;
	}

	.btn {
		flex: 1;
		height: 44px;
		line-height: 44px;
		border-radius: 22px;
		font-size: 16px;
		transition: all 0.3s;
	}

	.check-order {
		background: #fff;
		color: #4CAF50;
		border: 1px solid #4CAF50;
		margin-right: 15px;
	}

	.back-home {
		background: linear-gradient(135deg, #4CAF50, #45a049);
		color: #fff;
		box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
	}

	/* 动画效果 */
	@keyframes scaleIn {
		0% {
			transform: scale(0);
			opacity: 0;
		}

		60% {
			transform: scale(1.1);
			opacity: 1;
		}

		100% {
			transform: scale(1);
		}
	}
</style>
